/** 
 * 2011-10-10 下午02:23:11 
 * TcpClient.java 
 * author:sunb 
 */
package com.u6.tcp;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.lamfire.utils.Bytes;
import com.lamfire.utils.JSON;

/**
 * @author sunbin
 * 
 */
public class TcpClient  {

	public static void main(String[] args) {

		try{
			Socket socket = new Socket("10.8.8.29", 10000);
			OutputStream outputStream = socket.getOutputStream();
			InputStream inputStream = socket.getInputStream();

			
			while (true) {
				


				outputStream.write(Bytes.toBytes("asdasdasb掌声"));
				outputStream.flush();
				
				byte[] bs = new byte[100];
				inputStream.read(bs);

				
				System.out.println("result:"+new String(bs));
	
			}

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	

}
